<title>Detail User Right - Western</title>
<style>
fieldset.fifthy {	
	border-right: 0px;
	width: 30%;
}
fieldset.fifthy table{
	padding-right: 1px;
}
table.user td{
	vertical-align: top;   
}
</style>       
<?php $rs=$this->rs;
$url_access_user=$this->url(array('module'=>'userWu','controller'=>'user-access','action'=>'view-user-Access', null));	
$acl=($this->acl=='')? array():$this->acl;
$acl_name=($this->acl_name=='')? array(): $this->acl_name;
 $tr = Application_Form_FrmLanguages::getCurrentlanguage();
 $cancel_url=$this->url(array('module'=>'userWu','controller'=>'user-access','action'=>'index', null));
?>
<div class="right" style="width: 97%; padding: 10px;">
	<div class="btn" align="right">
			    <a class="negative" href="<?php echo $cancel_url;?>">
			        <img alt="" src="<?php echo BASE_URL?>/images/previous.gif">
			        <?php echo $tr->translate('BACK');?>
			    </a>
	</div>
	<form action="<?php echo $url_access_user; ?>" method="post">
		<div class="head_form">
			<?php echo $tr->translate('USER_ACCESS');?>
		</div>
		<div class="contain_form">
			<table>
				<tr>
					<td><?php echo $this->formsuser->getElement("acl_ids");?></td>
					<td><button name="save_module" value="save_module" class="btn btn-small btn-success" style="margin-left:15px;"><b><i class="fa fa-plus"></i></b> &nbsp; Add Module & Controller </button></td>				
					<td class="field"><span style="font-size: 14px">User Type</span></td>
					<td width="30%"><input id="disabledInput" class="form-control" type="text" disabled="" value="<?php echo $rs[0]['user_type'];?>" /></td>
				</tr>
			</table>
		</div>
	<br/>
	<div class="head_form">
		<?php echo $tr->translate('MODULE')."/".$tr->translate('CONTROLLER')."/".$tr->translate('ACTION')." ". $tr->translate('ASSIGNMENT');?>
	</div>
	<div class="contain_form">
			<table class="view-table shadow">
				<tr class="height">
					<td><?php echo $tr->translate('MODULE');?></td>
					<td width="30%"><select  name="fmod" id="fmod"><?php echo $this->optoin_mod;?></select></td>	
					<td><?php echo $tr->translate('CONTROLLER');?></td>
					<td width="30%"><select  class='demo-code-language' name="fcon" id="fcon"><?php echo $this->optoin_con;?></select></td>				
				</tr>	
				<tr class="height">
					<td><?php echo $tr->translate('ACTION');?></td>
					<td><select name="fact" class='demo-code-language' id="fact"><?php echo $this->optoin_act;?></select></td>	
					<td><?php echo $tr->translate('STATUS');?></td>
					<td><select name="fstatus" id="fstatus"><?php echo $this->optoin_status;?></select></td>				
				</tr>	
				<tr>
					<td class="add-edit btn" colspan="4" align="right">
						<input type="submit" value="<?php echo $tr->translate('SEARCH');?>" title="<?php echo $tr->translate('SEARCH');?>"/>
					</td>
				</tr>		
			</table>
		<br/>
		<?php echo $this->acl_name;?>		
	
	</div>
<?php $df = $this->datafiter;?>
</form>
</div>
<style>
<!--
	.pointer{
		cursor: pointer;	
	}
-->
</style>
<script>
	$(function(){		
		$('#fmod').val('<?php echo $df['fmod']?>');
		$('#fcon').val('<?php echo $df['fcon']?>');
		$('#fact').val('<?php echo $df['fact']?>');
		$('#fstatus').val('<?php echo $df['fstatus']?>');
	});

	function changeStatus(id, user_type){
		alert("OK");
		url = "<?php echo BASE_URL;?>/userWu/user-access/update-status";
		status = "no";
		none_src = "<?php echo BASE_URL?>/images/icon/none.png";
		tick_src = "<?php echo BASE_URL?>/images/icon/tick.png";

		if( $("#img_" + id).attr("src") == tick_src){
			status = "yes";
		}else status = "no";
		$.post( url, { 'acl_id': id, 'status': status, 'user_type_id':user_type},
	      function( data ) {
			 img_src = none_src;
	         if(data == "yes"){
				img_src = tick_src;
	         }else{
	        	 img_src = none_src
	         }        
	         $("#img_" + id).attr("src", img_src);
	      }
	    );
	}
</script>